<%--
    Document   : finished
    Created on : 16.10.2010, 00:56:38
    Author     : nico
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="u" uri="http://nixis.de/jsp/tags/core" %>

<p>
    Article has been added to your <a href="<u:url value="/todo" />">todo list</a>.
</p>

<c:if test="${fn:length(it.recommendations) > 0}">
    <p>
        One or more articles have been found which may also be of for you:
    </p>
    <ul>
        <c:forEach var="article" items="${it.recommendations}">
            <li><a target="_blank" href="<u:url value="/article/${article.sluggedId}" />">${article.title}</a></li>
        </c:forEach>
    </ul>
</c:if>

<script type="text/javascript">
    $("#add-todo-dialog").dialog({
        buttons: {
            Ok: function() {
                $(this).dialog("close");
            }
        }
    });
    
    $(".add-todo-link")
        .find("span")
            .removeClass("add")
            .end()
        .unbind("click")
        .attr("href", "<u:url value="/todo#todo-${it.todo.id}"/>");
</script>